import 'dart:async';
import 'package:shared_preferences/shared_preferences.dart';

class Cache{
 static Future<bool> saveCache(String key,String value) async{
    SharedPreferences prefs = await SharedPreferences.getInstance();
    return prefs.setString(key, value).then((ret){
       return ret;
    });
  }

 static Future<String> getCache(String key) async{
   SharedPreferences prefs = await SharedPreferences.getInstance();
   return prefs.get(key);
 }


 static Future<bool> saveListCache(String key,List value) async{
   SharedPreferences prefs = await SharedPreferences.getInstance();
   return prefs.setStringList(key, value).then((ret){
     return ret;
   });
 }
 static Future<List<String>> getListCache(String key) async{
   SharedPreferences prefs = await SharedPreferences.getInstance();
   return prefs.getStringList(key);
 }



}